package cn.imnaer.service.rpc.scenic.dao;

import java.util.List;

import org.bson.BSONObject;
import org.bson.BasicBSONObject;

import cn.imnaer.database.MatchConst;
import cn.imnaer.service.persistence.model.City;
import cn.imnaer.service.persistence.model.UserScenicInfo;
import cn.imnaer.service.rpc.common.AbstractRepository;

public class UserScenicRepository extends AbstractRepository<UserScenicInfo> {
	private UserScenicDaoImpl userScenicDaoImpl = UserScenicDaoImpl.getInstance();

	@Override
	public UserScenicInfo save(UserScenicInfo result) {
		return null;
	}

	@Override
	public UserScenicInfo findOneByPk(String pkValue, Class<?> clazz) {
		return null;
	}

	@Override
	public UserScenicInfo findOneByPk(String pkValue) {
		return null;
	}
/**
 *搜索某个用户创建的景点
 * @param keyword
 * @param userId
 * @return
 */
	public List<UserScenicInfo> search(String keyword, String userId) {
		BSONObject arg = new BasicBSONObject();
		BSONObject regex = new BasicBSONObject();
		regex.put(MatchConst._REGEX, keyword);
		arg.put("scenicName", regex);
		arg.put("userId", userId);
		return this.userScenicDaoImpl.findAll(arg, null);
	}

	@Override
	public List<UserScenicInfo> search(String keyword) {
		// TODO Auto-generated method stub
		return null;
	}

}
